package com.knight.spring.aop;

import com.knight.spring.aop.service.TestService;
import com.knight.spring.bean.Test1;
import org.springframework.beans.factory.support.BeanDefinitionReader;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class SpringAOPClient2 {
    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

    /*    Resource resource = new ClassPathResource("applicationContext-aop2.xml");

        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();

        BeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory);
*/
     /*   int num = beanDefinitionReader.loadBeanDefinitions(resource);
        System.out.println(num);*/

        Test1 testService = applicationContext.getBean("test1", Test1.class);

    }
}
